package com.springweb.unit4.annotated;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class AroundAdvice {
	@Pointcut("execution(* com.springweb.unit4.Performance.perform(..))")
	public void performance() {
	}
	
	@Around("performance()")
	public void watchPerformance(ProceedingJoinPoint jp) {
		try {
			System.out.println("Silencing ecell phones");
			System.out.println("Takeing seats");
			jp.proceed();
			System.out.println("CLAP !");
		} catch (Throwable e) {
			System.out.println("Demand a refund");
		}
	}
}
